#include "ufl.h"

using namespace ufl;

UFLInputSystem::UFLInputSystem()
:_pressKeyCode(-1), _mousePos(ufl_vertex_2i())
{

}

UFLInputSystem::~UFLInputSystem()
{

}

void UFLInputSystem::keyCallback(int key, int scancode, int action, int mods)
{
	if (action == GLFW_REPEAT)
	{
		_pressKeyCode = key;
	}
}

void UFLInputSystem::mouseEnterCallback(int entered)
{
	_mouseInWindow = entered;
}

void UFLInputSystem::mouseButtonCallback(int button, int action, int mods)
{

}

void UFLInputSystem::mousePosCallback(double xPos, double yPos)
{

}

bool UFLInputSystem::isPressKey(int code)
{
	return _pressKeyCode == code;
}

void UFLInputSystem::clear()
{
	_pressKeyCode = -1;
}

bool UFLInputSystem::isMouseInWindow()
{
	return _mouseInWindow == GL_TRUE;
}